package jp.sourceforge.akjrcp.flvtools.basic;

import jp.sourceforge.akjrcp.akj_betas.Akj_betasPlugin;
import jp.sourceforge.akjrcp.akj_betas.Messages;
import jp.sourceforge.akjrcp.ffmpeg.FFMpegOptions;

import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.RadioGroupFieldEditor;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;

public class AVISettingPage extends FieldEditorPreferencePage
implements IWorkbenchPreferencePage {
	public static final String AVI_VIDEO_CODEC="avisetting.video";
	public static final String AVI_AUDIO_CODEC="avisetting.audio";
	
	public AVISettingPage() {
		super(GRID);
		setPreferenceStore(Akj_betasPlugin.getDefault().getPreferenceStore());
		setDescription(Messages.getString("avisetting.description")); //$NON-NLS-1$
		initializeDefaults();
	}
	
	private void initializeDefaults() {
		
		// no one call it before open them

	}

	protected void createFieldEditors() {
		
        addField(new RadioGroupFieldEditor(
        		AVI_VIDEO_CODEC,
				Messages.getString("wmvsetting.video"), // //$NON-NLS-1$
				2,
				new String[][] { 
				{ Messages.getString("avisetting.msjpg"), FFMpegOptions.CODEC_VIDEO_MJPEG }, //$NON-NLS-1$ //$NON-NLS-2$
				{ Messages.getString("avisetting.xvid"), FFMpegOptions.CODEC_VIDEO_XVID }, //$NON-NLS-1$ //$NON-NLS-2$
				{ Messages.getString("wmvsetting.msmpeg4v1"), FFMpegOptions.CODEC_VIDEO_MSMPEG4V1 }, //$NON-NLS-1$ //$NON-NLS-2$
				{ Messages.getString("wmvsetting.msmpeg4v2"), FFMpegOptions.CODEC_VIDEO_MSMPEG4V2 }, //$NON-NLS-1$ //$NON-NLS-2$
				{ Messages.getString("avisetting.h264"), FFMpegOptions.CODEC_VIDEO_H264 }, //$NON-NLS-1$ //$NON-NLS-2$
				{ Messages.getString("avisetting.huffyuv"), FFMpegOptions.CODEC_VIDEO_HUFFYUV },
				{ Messages.getString("avisetting.copy"), FFMpegOptions.CODEC_COPY }
			}, getFieldEditorParent()));
        
        addField(new RadioGroupFieldEditor(
        		AVI_AUDIO_CODEC,
				Messages.getString("wmvsetting.audio"), // //$NON-NLS-1$
				2,
				new String[][] { 
				{ Messages.getString("wmvsetting.wmav1"), FFMpegOptions.CODEC_AUDIO_WMA1 }, //$NON-NLS-1$ //$NON-NLS-2$
				{ Messages.getString("wmvsetting.wmav2"), FFMpegOptions.CODEC_AUDIO_WMA2 }, //$NON-NLS-1$ //$NON-NLS-2$
				{ Messages.getString("avisetting.mp3"), FFMpegOptions.CODEC_AUDIO_MP3 }, //$NON-NLS-1$ //$NON-NLS-2$
				{ Messages.getString("avisetting.wav"), FFMpegOptions.CODEC_AUDIO_WAV },
				{ Messages.getString("avisetting.copy"), FFMpegOptions.CODEC_COPY },
				{ Messages.getString("avisetting.none"), FFMpegOptions.NONE }
				
			}, getFieldEditorParent()));
        
	}

	public void init(IWorkbench workbench) {
		// TODO Auto-generated method stub
		
	}

}
